<?php 
$section = 'user';
$link = 'category/';
?>
<div class="panel-admin">
    <h1>Danh sách user</h1>
    <div class="form-admin">
       <?php 
            $this->widget('zii.widgets.grid.CGridView',
                array('dataProvider' => $model->search(),
                'cssFile' => Yii::app()->request->baseUrl . '/css/backend/style-grid.css',
                'enableSorting' => true,
                'emptyText' => "Chưa có dữ liệu nha pà kon",
                    
                            'id'=>'category-grid',
                            'filter'=>$model,
                           
                            'columns'=>array(
                                array(
                                    'name'=>'name',
                                    'filter'=> $this->widget('zii.widgets.jui.CJuiAutoComplete', 
                                                            array(
                                                                'name'=>'name',
                                                                'model'=>$model,
                                                                'options'=>array(
                                                                    'minLength'=>'2',
                                                                ),
                                                                'htmlOptions'=>array(
                                                                    'size'=>'20'
                                                                ),
                                                            ), true),
                                ),
               					
                                'description',
                                array (
                                	'header'=>'Ten cha',
                                	'name'=>'categoryParent',
                                    'value'=>'$data->categoryParent->name',
                                    'filter'=> $this->widget('zii.widgets.jui.CJuiAutoComplete', 
                                    array(
                                        'name'=>'name',
                                        'model'=>$model,
                                        'options'=>array(
                                            'minLength'=>'2',
                                        ),
                                        'htmlOptions'=>array(
                                            'size'=>'10'
                                        ),


                                    ), true),
                                ),
                            array(
                                'class'=>'CButtonColumn',
                                    'buttons'=>array(
                                        'delete'=>array(
                                                'visible'=>'true',
                                        ),

                                        
                                    ),
                                //'deleteConfirmation'=>"js:'Do you really want to delete record with ID '+$(this).parent().parent().children(':nth-child(2)').text()+'?'",

                                  'viewButtonUrl'=>'Yii::app()->baseUrl."/category/view/".$data->id',
                                  'updateButtonUrl'=>'Yii::app()->baseUrl."/category/form/".$data->id',
    ),
                            )
                        ));
        ?>
    </div>
</div>